<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<link rel="stylesheet" href="../css/zhuce.css">
<body>
    <div class="box">
        <div class="box_logo">
            <span>美发管理系统 </span>
        </div>
        <div class="box_cent">
            <div class="box-centinp">
                <div>用户名 <input type="text" class="yhm"></div>
                <div>密&nbsp;&nbsp; 码 <input type="password" style="margin-left: 32px;" class="mm"></div>
                <div>确认密码 <input type="password" style="margin-left: 5px;" class="mm1"></div>
            </div>
            <div class="box-centbut">
                <button class="col zc">注册</button>
                <button class="dl">登录</button>
            </div>
        </div>
    </div>
    <script src="../jQuery库/jquery-1.10.1.js"></script>
    <script src="../js/besaurl.js"></script>
    <script>
        console.log($('.zc'))
        $('.zc').click(function(){
            if($('.mm1').val()==$('.mm').val()){
                $.ajax({
                    method:'post',
                    url:besaurl+'register',
                    data:{
                        user_name:$('.yhm').val(),
                        password:$('.mm').val()
                    },
                    success:function(data){
                        console.log(data);
                        window.location='./denglu.html'
                    },error:function(err){
                        console.log(err);
                    }
                })
            }else{
                console.log('两次密码输入的不相同')
            }
            
        })
        $(".dl").click(function(){
            window.location="./denglu.html"
        })
        
    </script>
</body>
</html>